using System;

namespace Work.API.Dtos.DrugManagement
{
    /// <summary>
    /// 检药单DTO（用于查看检药单模块）
    /// </summary>
    public class InspectionListDto
    {
        /// <summary>
        /// 检药单ID
        /// </summary>
        public int InspectionId { get; set; }

        /// <summary>
        /// 处方明细ID
        /// </summary>
        public int PrescriptionItemId { get; set; }

        /// <summary>
        /// 预约编号
        /// </summary>
        public int AppointmentId { get; set; }

        /// <summary>
        /// 患者ID
        /// </summary>
        public int PatientId { get; set; }

        /// <summary>
        /// 挂号编号（冗余字段，便于快速查询）
        /// </summary>
        public string? RegistrationNum { get; set; }

        /// <summary>
        /// 患者姓名（冗余字段）
        /// </summary>
        public string? PatientName { get; set; }

        /// <summary>
        /// 患者性别
        /// </summary>
        public bool? Gender { get; set; }

        /// <summary>
        /// 性别文本
        /// </summary>
        public string? GenderText => Gender.HasValue ? (Gender.Value ? "男" : "女") : null;

        /// <summary>
        /// 患者年龄
        /// </summary>
        public int? Age { get; set; }

        /// <summary>
        /// 患者身份证号
        /// </summary>
        public string? IdCard { get; set; }

        /// <summary>
        /// 卡号（冗余字段）
        /// </summary>
        public string? CardNumber { get; set; }

        /// <summary>
        /// 药品ID（冗余字段）
        /// </summary>
        public int? DrugId { get; set; }

        /// <summary>
        /// 药品名称（冗余字段）
        /// </summary>
        public string? DrugName { get; set; }

        /// <summary>
        /// 检查状态（待检查/已检查/已发药）
        /// </summary>
        public string? InspectionStatus { get; set; }

        /// <summary>
        /// 检查日期
        /// </summary>
        public DateTime? InspectionDate { get; set; }

        /// <summary>
        /// 检查人（执行检查操作的人员）
        /// </summary>
        public string? Inspector { get; set; }

        /// <summary>
        /// 检查结果（正常/过期/损坏等）
        /// </summary>
        public string? InspectionResult { get; set; }

        /// <summary>
        /// 处理方式（继续使用/报废/退回等）
        /// </summary>
        public string? HandlingMethod { get; set; }

        /// <summary>
        /// 是否已发药（已发药/未发药）
        /// </summary>
        public bool IsDispensed { get; set; } = false;

        /// <summary>
        /// 发药日期（可选）
        /// </summary>
        public DateTime? DispensedDate { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string? Remarks { get; set; }
    }
}

